package com.dmp.customer.service.impl;


import com.dmp.common.util.DateUtil;
import com.dmp.common.util.StringUtil;
import com.dmp.customer.entity.Customer;
import com.dmp.customer.mapper.CustomerMapper;
import com.dmp.customer.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: Xiaohei
 * @CreateTime: 2021/12/27 21:52
 */
@Service("customerService")
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public boolean addCustomer(Customer customer) {
        customer.setUuid(StringUtil.getUUID());
        String nowTime = DateUtil.currentMillis();
        customer.setCreateTime(nowTime);
        customer.setFlag("1");
        customerMapper.insert(customer);
        return true;
    }
}
